package com.xxx.dorm.service.impl;

import com.xxx.dorm.dao.RecordDao;
import com.xxx.dorm.dao.StudentDao;
import com.xxx.dorm.dao.impl.RecordDaoImpl;
import com.xxx.dorm.dao.impl.StudentDaoImpl;
import com.xxx.dorm.domain.Record;
import com.xxx.dorm.service.RecordService;

import java.util.List;

public class RecordServiceImpl implements RecordService {

    private RecordDao recordDao = new RecordDaoImpl();
    private StudentDao studentDao = new StudentDaoImpl();

    @Override
    public List<Record> findAll() {
        //封装Record
        List<Record> records = recordDao.findAllRecord();
        return records;
    }

    @Override
    public void addRecord(Record record) {
        recordDao.addRecord(record);
    }

    @Override
    public Record findRecord(Integer rid) {
        Record record = recordDao.findById(rid);
        return record;
    }

    @Override
    public void updateRecord(Record record) {
        recordDao.updateRecord(record);
    }

    @Override
    public void deleteRecord(Integer id) {
        recordDao.deleteRecord(id);
    }

    @Override
    public List<Record> find(String conditions, String information) {
        return recordDao.find(conditions,information);
    }
}
